Skip to content

Conversation

@ebassi
Copy link
Owner

@ebassi ebassi commented Jun 18, 2020

Instead of using bytewise comparison, use isinf() and hope it works
correctly with single precision floats on the target platform;
additionally, since the negative return value for negative infinities is
a GNU extension, use signbit() to check if the number is a positive or
negative infinity.

Proposed changes:

  • change the fallback path for the is_empty() and is_infinity() methods of graphene_box_t

Instead of using bytewise comparison, use isinf() and hope it works
correctly with single precision floats on the target platform;
additionally, since the negative return value for negative infinities is
a GNU extension, use signbit() to check if the number is a positive or
negative infinity.
return min_cmp == 0 && max_cmp == 0;
float vmin[3], vmax[3];

graphene_simd4f_dup_3f (box->min.value, vmin);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could move these out of the #ifdef branch and save some duplicated lines (same below)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants